<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>节点列表</title>
    <link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
    <script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
    <script language="javascript" src="<%=path %>/js/syAjax.js"></script>
    <script type="text/javascript">
      window.onload=function()
      {
      	 parent.location.hash="top";
         
         
		 resizeIframe();
		new Anim.DD($("items"), $("title"));
		$("items").style.left = 10;
		$("items").style.top = "10px";
      };
      
  
	 function go(url)
    {
      window.location.href=url;
    }
    
      //显示遮罩
      function displayModuleDiv(divId){
    
		document.getElementById(divId).style.display = "";	
		resizeIframe();
			
	}
	
	function closeDIV(divId){
		document.getElementById("videoid").value="";
		document.getElementById("videoname").value="";
		document.getElementById("videosort").value="0";
		document.getElementById("videourl").value="";
		document.getElementById("videoremark").value="";
		document.getElementById(divId).style.display = "none";
	}
	
	function updateVideo(id,name,sort,url,remark){
		document.getElementById("videoid").value=id;
		document.getElementById("videoname").value=name;
		document.getElementById("videosort").value=sort;
		document.getElementById("videourl").value=url;
		document.getElementById("videoremark").value=remark;
		displayModuleDiv("items");
	}
	
	function deleteVideo(id){
		window.location.href="<%=path%>/deleteVideoSetSchoolGradeAndClassAction.action?videoSetSchool.id="+id;
	}
	
	function isNumber(str){
	    	var re = /^[0-9]*$/;
	    	if(str!='' && re.test(str) && str.length<5)
	    	{
	    		return true;
	    	}else{
	    		return false;
	    	}
    	}
    	
	function doSubmit(){
		var videosort = document.getElementById('videosort').value;
    	if(!isNumber(videosort)){
			alert("序号必须为5位以内整数");
			return;
		}
		document.myform.submit();
	}
    </script>
  </head>
  
  <body>
  <input type="hidden" name="videoGradeId" value="${requestScope.videoGradeId }"/>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="left" class="f_5">监控设置</td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#9DD12E"></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="bottom" background="<%=path %>/images/sywesp_24.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="90" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="1" align="left" valign="bottom" bgcolor="#CBCBCB"></td>
                  <td align="center" background="<%=path %>/images/sywesp_18.gif" class="f_6" onclick="go('<%=path %>/videoSetClassGradeAndClassAction.action?');" style="cursor:pointer;">班级监控</td>
                  <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
                </tr>
              </table></td>
              <td width="5" align="left">&nbsp;</td>
              <td width="90" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="1" align="left" valign="bottom" bgcolor="#CBCBCB"></td>
                    <td align="center" background="<%=path %>/images/sywesp_25.gif" class="f_9">校园监控</td>
                    <td width="1" height="31" align="right" valign="bottom" bgcolor="#CBCBCB"></td>
                  </tr>
              </table></td>
          
              <td width="5" align="left">&nbsp;</td>
              <td align="left">&nbsp;</td>
              </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" class="tb_8 border_2">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="25" align="right" >
              
             </td>
            <td align="right" valign="top">&nbsp;<img src="<%=path %>/images/icon_12.gif" width="18" height="18" align="absmiddle" /><a href="javascript:displayModuleDiv('items');">新建监控地区</a></td>
          </tr>
          <tr>
            <td colspan="2" align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="2" height="24" align="left" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_20.gif" width="2" height="24" /></td>
                      <td align="left" background="<%=path %>/images/sywesp_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="1%">&nbsp;</td>
                            <td width="10%" align="left" class="f_8" nowrap="nowrap"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />序号</td>
                            <td width="20%" align="left" class="f_8" nowrap="nowrap"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />监控地区名称</td>
                            <td align="left" class="f_8" nowrap="nowrap"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />监控地址</td>
                            <td width="20%" align="left" class="f_8" nowrap="nowrap"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />备注</td>
                            <td width="10%" align="left" class="f_8" nowrap="nowrap"><img src="<%=path %>/images/sywesp_23.gif" width="8" height="22" align="absmiddle" />操作</td>                      
                          </tr>
                      </table></td>
                      <td width="4" align="right" background="<%=path %>/images/sywesp_21.gif"><img src="<%=path %>/images/sywesp_22.gif" width="4" height="24" /></td>
                    </tr>
                </table></td>
              </tr>
              <tr>
                <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="25" align="left" valign="top" class="tb_7">
                        <c:choose>
                          <c:when test="${! empty requestScope.VIDEOLIST}">
                            <c:forEach items="${requestScope.VIDEOLIST}" var="v">
                              <table width="100%" border="0" cellspacing="1" cellpadding="0" style="border-bottom: solid #CCCCCC 1px;">
		                          <tr>
		                            <td width="1%" height="25" align="right" valign="bottom">&nbsp;</td>
		                            <td width="10%" align="left" valign="bottom">&nbsp;${v.sort }</td>
		                            <td width="20%" align="left" valign="bottom">&nbsp;${v.name }</td>
		                            <td align="left" valign="bottom">${v.url }</td>
		                            <td width="20%" align="left" valign="bottom">${v.remark }</td>
                            		<td width="10%" align="left" valign="bottom">
                            		<a href="javascript:updateVideo('${v.id }','${v.name }','${v.sort }','${v.url }','${v.remark }');"><img src="<%=path %>/images/icon_5.gif" width="15" height="16" border="0" /></a> &nbsp;<a href="javascript:deleteVideo('${v.id }');" onclick="return confirm('确定删除？');"><img src="<%=path %>/images/icon_11.gif" width="12" height="12" border="0" /></a>
                            		</td>
		                          </tr>
		                       </table>
                            </c:forEach>
                          </c:when>
                          <c:otherwise><table align="center"><tr><td colspan="4" align="center"><font color="#CCCCCC">无相关信息</font></td></tr></table></c:otherwise>
                        </c:choose>
                      </td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
          </tr>
         
       
          
          
          
        </table></td>
      </tr>
     
    </table></td>
  </tr>
</table>
 



<!-- 添加开始 -->
<div id="items" style="position: absolute; width: 500px;height:150px; top:100px; left:200px; padding-bottom:8px; background-color:#ECF7FD;z-index:10; border:3px solid #3A6EA5;display: none;" >
<div style="width:100%;top:100px;left:200px;" id="title">
<table border="0" width="100%" cellpadding="0" cellspacing="0" align="center" bgcolor="#3A6EA5">
<tr style=" height: 30px;">
<td>&nbsp;&nbsp;<font color='#FFFFFF'>新建监控地区</font></td>
<td align="right"><a href="javascript:closeDIV('items');" style="text-decoration: none;"><span style="color: #000000; font-size:;">[关闭]</span></a></td>
</tr>
</table>
</div>
 <form name="myform" action="<%=path %>/addOrUpdateGradeAndClassAction.action" method="post">
  <input id="videoid" type="hidden" name="videoSetSchool.id" value=""/>
<table width="490" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top" bgcolor="" class="border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top" class="tb_10 border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
            <td width="10%" height="28" align="right" class="f_4" nowrap="nowrap">序号：</td>
            <td width="90%" colspan="2" align="left"><input id="videosort" type="text" name="videoSetSchool.sort"  size="50" value="0"/></td>
            
          </tr>
          <tr>
            <td width="10%" height="28" align="right" class="f_4" nowrap="nowrap">监控地区名称：</td>
            <td width="90%" colspan="2" align="left"><input id="videoname" type="text" name="videoSetSchool.name"  size="50"/></td>
            
          </tr>
           <tr>
            <td width="10%" height="28" align="right" class="f_4" nowrap="nowrap">监控地址：</td>
            <td width="90%" colspan="2" align="left"><input id="videourl" type="text" name="videoSetSchool.url"  size="50"/></td>
            
          </tr>
           <tr>
            <td width="10%" height="28" align="right" class="f_4" nowrap="nowrap">备注：</td>
            <td width="90%" colspan="2" align="left"><input id="videoremark" type="text" name="videoSetSchool.remark"  size="50"/></td>
            
          </tr>
       		
         
       
          
          
          
          
         
        </table>
        </td>
      </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="30" align="center" valign="middle"><input type="button" value="提 交" onclick="doSubmit();" /></td>
        </tr>
      </table></td>
  </tr>
</table>
</form>

<!-- 添加结束 -->

  
  </body>
</html>
